package com.heima.kafka.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: xsz
 * @DateTime: 2024/4/2 0:28
 **/

@RestController
public class HelloController {

    @Autowired
    private KafkaTemplate<String,String> kafkaTemplate;


    @GetMapping("/hello")
    public String hello(){
        kafkaTemplate.send("itcast-topic","hei ma cheng yu yuan");
        return "ok";
    }

}
